<!DOCTYPE html>
<html>
<head>
    <title>物流列表</title>
    <#include "/header.html">
</head>
<body>
<div id="twbOrderLogisticsApp" v-cloak>
    <!-- 查询选项 -->
    <el-row>
        <el-form :inline="true" class="demo-form-inline" size="small">
            <el-form-item>
                <el-input v-model.trim="q.orderNo" placeholder="订单号"></el-input>
            </el-form-item>
            <el-form-item>
                <el-input v-model.trim="q.logisticsName" placeholder="物流名称"></el-input>
            </el-form-item>
            <el-form-item>
                <el-input v-model.trim="q.logiNo" placeholder="物流单号"></el-input>
            </el-form-item>
            <el-form-item>
                <el-select v-model="q.finStatus" placeholder="付款状态" size="small">
                    <el-option
                            v-for="item in twbFinStatus"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-row :gutter="10">
                    <el-col :span="11"><div class="grid-content bg-purple"><el-input-number v-model.trim="q.beginLogiCost" :min="0" :max="999999"></el-input-number></div></el-col>
                    <el-col :span="2">至</el-col>
                    <el-col :span="11"><div class="grid-content bg-purple"><el-input-number v-model.trim="q.endLogiCost" :min="0" :max="999999"></el-input-number></div></el-col>
                </el-row>
            </el-form-item>
            <el-form-item>
                <el-date-picker
                        style="width: 300px"
                        v-model="q.createTime"
                        type="daterange"
                        align="right"
                        value-format="yyyy-MM-dd"
                        unlink-panels
                        start-placeholder="开始日期"
                        end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>

            <el-form-item>
                <el-button type="primary" @click="search" plain size="small" icon="el-icon-search">查询</el-button>
                <el-button type="primary" @click="reset"  plain size="small" icon="el-icon-refresh">重置</el-button>
            </el-form-item>
        </el-form>
    </el-row>

    <el-row>
        <span style="color: #F56C6C">物流总费用：{{totalAmount}}</span>
    </el-row>
    <div style="margin-bottom: 15px;"></div>
    <el-row>
        <el-button type="primary" @click="batchPaymentDialog" plain size="small">批量付款</el-button>
    </el-row>
    <div style="margin-bottom: 15px;"></div>

    <!-- 列表 -->
    <el-table size="mini" ref="twbOrderLogisticsTable" :data="twbOrderLogisticsData" border style="width: 100%" >
        <el-table-column type="selection" width="50"></el-table-column>
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column prop="orderNo" label="订单号"></el-table-column>
        <el-table-column prop="logisticsName" label="物流名称"></el-table-column>
        <el-table-column prop="logiNo" label="物流单号"></el-table-column>
        <el-table-column prop="logiCost" label="物流费用"></el-table-column>
        <el-table-column prop="logiRemark" label="物流备注" show-overflow-tooltip></el-table-column>
        <el-table-column prop="createTime" label="添加时间"></el-table-column>
        <el-table-column prop="twbFinanceStatusText" label="付款状态">
            <template slot-scope="scope">
                <span style="color: #67C23A;" v-if="scope.row.twbFinanceStatusText == '已付款'">{{scope.row.twbFinanceStatusText}}</span>
                <span style="color: #F56C6C;" v-else>{{scope.row.twbFinanceStatusText}}</span>
            </template>
        </el-table-column>
    </el-table>

    <div style="text-align: center;margin: 15px">
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="page.currentPage"
                :page-sizes="page.pageSizes"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next"
                :total="page.total">
        </el-pagination>
    </div>

    <!-- 付款弹框 -->
    <el-dialog title="批量付款" :visible.sync="logiPayFormVisible" width="420px">
        <el-form :model="logiPayForm">
            <el-form-item label="付款日期" label-width="80px">
                <el-date-picker v-model="logiPayForm.logiPaytime" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" style="width: 300px;"></el-date-picker>
            </el-form-item>
            <el-form-item label="付款备注" label-width="80px">
                <el-input v-model="logiPayForm.logiPayRemark" type="textarea" :autosize="{ minRows: 2, maxRows: 6}" placeholder="请输入备注信息">
                </el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="batchPayment" size="mini">确 定</el-button>
            <el-button @click="logiPayFormVisible = false" size="mini">取 消</el-button>
        </div>
    </el-dialog>

</div>

<script src="${request.contextPath}/statics/js/modules/logistics/twbOrderLogistics.js?_${.now?long}"></script>
</body>
</html>